package com.rrd.itext.obj;

import java.io.IOException;

import com.itextpdf.text.BaseColor;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Font;
import com.itextpdf.text.Phrase;
import com.itextpdf.text.pdf.BaseFont;

public class PhraseObject extends BaseObject{
	private String 		phrase;
	private int 		fontColorR;
	private int 		fontColorG;
	private int 		fontColorB;
	private int 		fontSize;
	private String 		fontFamily;
	private int	 		fontStyle;

	public String getPhrase() {
		return phrase;
	}
	public void setPhrase(String phrase) {
		this.phrase = phrase;
	}
	public int getFontColorR() {
		return fontColorR;
	}
	public void setFontColorR(int fontColorR) {
		this.fontColorR = fontColorR;
	}
	public int getFontColorG() {
		return fontColorG;
	}
	public void setFontColorG(int fontColorG) {
		this.fontColorG = fontColorG;
	}
	public int getFontColorB() {
		return fontColorB;
	}
	public void setFontColorB(int fontColorB) {
		this.fontColorB = fontColorB;
	}
	public int getFontSize() {
		return fontSize;
	}
	public void setFontSize(int fontSize) {
		this.fontSize = fontSize;
	}
	public String getFontFamily() {
		return fontFamily;
	}
	public void setFontFamily(String fontFamily) {
		this.fontFamily = fontFamily;
	}
	public int getFontStyle() {
		return fontStyle;
	}
	public void setFontStyle(int fontStyle) {
		this.fontStyle = fontStyle;
	}
	
	public Phrase getPhraseObj() throws DocumentException, IOException{
		BaseFont bf = BaseFont.createFont(this.fontFamily,
				BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
		
		Font f = new Font(bf);
		f.setColor(new BaseColor(this.fontColorR, this.fontColorG, this.fontColorB));
		f.setSize(12);
		f.setStyle(this.fontStyle);
		return new Phrase(this.phrase, f);

	}
	
}
